import { Column, Entity, PrimaryGeneratedColumn, Unique } from 'typeorm';

@Entity('user_role')
@Unique('user_role_deleted', ['role_id'])
export class UserRoleEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
  })
  id: number;

  @Column({
    type: 'bigint',
    nullable: false,
    width: 20,
  })
  user_id: number;

  @Column({
    type: 'int',
    nullable: true,
    comment: '角色id',
  })
  role_id: number;

  @Column({
    type: 'bigint',
    nullable: true,
    width: 20,
  })
  team_id: number;

  @Column({
    type: 'varchar',
    nullable: true,
    length: 45,
  })
  type: string;

  @Column({ type: 'bigint', width: 13 })
  create_time?: number;
  @Column({ type: 'bigint', width: 13 })
  update_time?: number;
}
